Wraps a nkMaths::Vector and offers functions for use in scripting.
More...
Wraps a nkMaths::Vector and offers functions for use in scripting.
◆ updateEnvironment()
Updates a given environment and set it up to use all functions wrapped by this wrapper.
- Parameters
-
env | The environment to set up. |
◆ constructor()
static void* nkAstraeus::lua::nkMathsWrap::VectorWrapper::constructor |
( |
const nkScripts::DataStack & |
stack | ) |
|
|
static |
Wrapper function for the constructor of the user type.
local t = nkMaths.Vector.new() ;
- Parameters
-
stack | The parameter stack. |
- Returns
- An output value with the user type and data allocated.
◆ destructor()
static void nkAstraeus::lua::nkMathsWrap::VectorWrapper::destructor |
( |
void * |
toDestroy | ) |
|
|
static |
Wrapper function for the destructor of the user type.
- Parameters
-
toDestroy | The data that has to be freed. |
◆ newVec2()
Wrapper function for the constructor of the user type. Will map to the vector 2 constructor.
local t = nkMaths.Vector.newVec2(x, y) ;
- Parameters
-
stack | The parameter stack. |
- Returns
- An output value with the user type and data allocated.
◆ newVec3()
Wrapper function for the constructor of the user type. Will map to the vector 3 constructor.
local t = nkMaths.Vector.newVec3(x, y, z) ;
- Parameters
-
stack | The parameter stack. |
- Returns
- An output value with the user type and data allocated.
◆ newVec4()
Wrapper function for the constructor of the user type. Will map to the vector 4 constructor.
local t = nkMaths.Vector.newVec4(x, y, z, w) ;
- Parameters
-
stack | The parameter stack. |
- Returns
- An output value with the user type and data allocated.
◆ getX()
Wrapper function for the nkMaths::Vector::getX(), exposed as an attribute getter.
local d = v.x ;
- Parameters
-
vector | The data from which the attribute will be retrieved. |
- Returns
- The attribute value, as a float.
◆ getY()
Wrapper function for the nkMaths::Vector::getY(), exposed as an attribute getter.
local d = v.y ;
- Parameters
-
vector | The data from which the attribute will be retrieved. |
- Returns
- The attribute value, as a float.
◆ getZ()
Wrapper function for the nkMaths::Vector::getZ(), exposed as an attribute getter.
local d = v.z ;
- Parameters
-
vector | The data from which the attribute will be retrieved. |
- Returns
- The attribute value, as a float.
◆ getW()
Wrapper function for the nkMaths::Vector::getW(), exposed as an attribute getter.
local d = v.w ;
- Parameters
-
vector | The data from which the attribute will be retrieved. |
- Returns
- The attribute value, as a float.
◆ setX()
Wrapper function for nkMaths::Vector::setX(), exposed as an attribute setter.
v.x = 0.2 ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, empty.
◆ setY()
Wrapper function for nkMaths::Vector::setY(), exposed as an attribute setter.
v.y = 0.2 ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, empty.
◆ setZ()
Wrapper function for nkMaths::Vector::setZ(), exposed as an attribute setter.
v.z = 0.2 ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, empty.
◆ setW()
Wrapper function for nkMaths::Vector::setW(), exposed as an attribute setter.
v.w = 0.2 ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, empty.
◆ getDistance()
Wrapper function for nkMaths::Vector::getDistance().
local d = v:getDistance(p) ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, as a float.
◆ toString()
Overrides the default string conversion function.
print(v) ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, as a string.
◆ add()
Overrides the default add operation for the user type.
local v = p + t ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, as a nkMaths::Vector.
◆ sub()
Overrides the default subtract operation for the user type.
local v = p - t ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, as a nkMaths::Vector.
◆ mul()
Overrides the default multiply operation for the user type.
local v = p * t ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, as a nkMaths::Vector.
◆ div()
Overrides the default divide operation for the user type.
local v = p / t ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, as a nkMaths::Vector.
◆ eq()
Overrides the default equality operation for the user type.
local v = p == t ;
- Parameters
-
stack | The parameter stack. |
- Returns
- The output value, as a bool.
The documentation for this class was generated from the following file:
- Documentation/Headers/NilkinsAstraeus/Scripts/Lua/nkMathsWrap/Algebra/VectorWrapper.h